//
// Created by antler on 2018/12/6.
//

#ifndef LUA_SIZE_H
#define LUA_SIZE_H

#include "luaext/point/Point.h"

#define CLASSNAME_SIZE "Size"
#define USERTYPE_SIZE "Size"

class Size {
public:
    static Size ZERO;
    static Size INVALID;

public:
    static Size *create();

    static Size *createWith(int w, int h);

    static Size *createWith(const Point &point);

    static Size *createWith(const Size &size);

    Size();

    Size(int w, int h);

    Size operator+(const Size &size) const;

    Size operator-(const Size &size) const;

    Size operator*(int ratio) const;

    Size operator/(int ratio) const;

    bool operator==(const Size &size) const;

    Size operator-() const;

public:
    int width;
    int height;
};


#endif //LUA_SIZE_H
